const mongoose = require("mongoose");
mongoose.pluralize(null); //去掉集合后面的s
const { Schema, model } = mongoose;
const versionKey = { versionKey: false };
const moment = require("moment");
moment.locale("zh-cn");

// 每日推荐
const DailyrecomSchema = new Schema(
  {
    imageUrl: String,
    title: String,
    address: String,
    color: String,
    time: {
      type: String,
      default: moment().utcOffset(8).format("YYYY-MM-DD"),
    },
    timestamp: {
      type: Number,
      default: () => moment().unix(),
    },
  },
  versionKey
);


module.exports = {
    modelDairecom: model("dailyrecom", DailyrecomSchema),
}